Skip to content

Fix broken methods in LinearSerializedMagnetModel#254

Merged
gupichon merged 1 commit into
mainfrom
253-bugfix-get_devices-broken-for-serialized-magnets
Apr 24, 2026
Merged

Fix broken methods in LinearSerializedMagnetModel#254
gupichon merged 1 commit into
mainfrom
253-bugfix-get_devices-broken-for-serialized-magnets

Conversation

@gupichon
Copy link
Copy Markdown
Contributor

@gupichon gupichon commented Apr 24, 2026

Summary

  • Fix four AttributeError bugs in LinearSerializedMagnetModel caused by wrong field names (powerconverters, units) and misplaced attribute access (_cfg.__sub_models)
  • Rework compute methods to reflect physical reality: one power converter drives N serialized magnets in series
  • get_devices() now returns a single device; compute_strengths accepts one current and returns N strengths; compute_hardware_values accepts N strengths and returns one current

Closes #253

Test plan

  • All 145 existing tests pass
  • test_get_devices verifies len(get_devices()) == 1 and that strength set/get remains consistent

…eld names, misplaced attribute access).

Rework compute methods to reflect physical reality: one power converter per series, compute_strengths accepts one current and returns N strengths, compute_hardware_values accepts N strengths and returns one current.
@gupichon gupichon linked an issue Apr 24, 2026 that may be closed by this pull request
@gupichon gupichon self-assigned this Apr 24, 2026
@gupichon gupichon added the bug Something isn't working label Apr 24, 2026
@gupichon gupichon merged commit 1b002f2 into main Apr 24, 2026
3 checks passed
@gubaidulinvadim gubaidulinvadim deleted the 253-bugfix-get_devices-broken-for-serialized-magnets branch April 24, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BugFix: get_devices() broken for serialized magnets

4 participants